# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=py3-magic
_pkgname=python-magic
pkgver=0.4.24
pkgrel=1
pkgdesc="Python3 wrapper for libmagic"
url="https://pypi.python.org/pypi/python-magic/"
arch="noarch"
license="MIT"
depends="python3 libmagic"
makedepends="py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://github.com/ahupp/$_pkgname/archive/$pkgver.tar.gz
	file-5.41.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-magic" # Backwards compatibility
provides="py-magic=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	LC_ALL=en_US.UTF-8 PYTHONPATH="$PWD/build/lib" python3 test/test.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
b3ec148da398293465299938fabf691b56c4b3876f6abbb7a734a9c0a5180cc758a15f7085bbf1bf40ec6031697ec84d98c161db1fd04301133af09928c611fc  py3-magic-0.4.24.tar.gz
59ec867ba2ae2e9a80bf178cba04eb4c19ba2e8fa4f372bfaa96946c74098b9ba5f701df39263256f41751ba37fe380a79cd9cf81d7aba5369397639147aa83a  file-5.41.patch
"
